import argparse
import os
import shutil

def COMMIT(filepath):
    source_path = os.path.join(".git","Stage", filepath)
    target_path = os.path.join(".git","Repository", filepath)

    if not os.path.exists(source_path):
        print(f"错误：文件 {filepath} 不存在于暂存区。")
        return

    shutil.move(source_path, target_path)
    print(f"文件 {filepath} 成功提交到版本库。")

# if __name__ == "__main__":
#     parser = argparse.ArgumentParser(description='Commit file from staging area to repository.')
#     parser.add_argument('filepath', type=str, help='File path to commit')

#     args = parser.parse_args()
#     filepath = args.filepath

#     commit_file(filepath)
    